|
|
|
|
|
|
|
DataField settings for each text box and the suggested captions for the corresponding label controls. The table uses the default names for the text boxes. |
|
|
|
|
| Table 25.2 DataField and Caption Settings for the Data Access Form | | TextBox Name | DataField | Caption for Corresponding Label | | Text1 | Au_ID | Author ID: | | Text2 | Author | Name: | | Text3 | Year Born | Year Born: |
|
|
|
|
|
|
After you add the bound controls and set their properties, your form should look like the one shown in Figure 25.8. |
|
|
|
|
|
|
|
|
Figure 25.8
You can create a simple data entry form by
using just the Data control and bound text boxes. |
|
|
|
|
|
|
|
|
The DataSource property cannot be set at runtime using the standard Data control. However, if you use the new ADO Data control (discussed in Chapter 28, "Using ActiveX Data Objects (ADO)"), you can set this property. |
|
|
|
|
|
|
|
|
See "Using the ADO Data Control,"p. 614 |
|
|
|
|
|
|
|
|
Now that you have created the data entry form, try it out by running the program. As the program first starts, you should see the form load, and the information for the first record should appear in the text boxes. Now you can see how the Data control is used to navigate through the records of the database. You can move to the first record, the previous record, the next record, or the last record by clicking the appropriate button on the Data control. |
|
|
|
|
|
|
|
|
With this simple program, you can even update and edit the database. Try typing a year in the Year Born text box and moving to another record. By doing so, you are modifying a record in the physical database that is bound to the Data control. Even if you turn off the power on your PC, the record remains changed in the BIBLIO.MDB file. |
|
|
|
 |
|
 |
|
|
Random Records |
|
|
|
 |
|
 |
|
|
You look at your database and notice that the records of the database seem to be in random order, not alphabetical order. You have not created an error or done anything wrong in setting up the form. You are seeing the records presented in the physical order of the table, the order in which the records |
|
|
|
|
|